home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 1 / ETO Development Tools 1.iso / Essentials / MacApp Documentation / MacApp AppleLink Messages / MacApp.Tech$ 12⁄8⁄89 / 0166-DoInitViews again-Dec89 < prev    next >
Encoding:
Text File  |  1989-12-08  |  2.5 KB  |  63 lines  |  [TEXT/GEOL]

  1. Item    5182108                         4-Dec-89        14:38
  2.  
  3. From:   D1282                           Power Up,PRT
  4.  
  5. To:     MACAPP.TECH$                    MacApp Technical
  6.         KEMINK1                         Kemink, Joost
  7.  
  8. Sub:    DoInitViews again
  9.  
  10. Attn:  MacApp.Tech$
  11. Attn: Kemink, Joost
  12. SentBy: James Plamondon
  13. Date   12/4/89
  14. Subject    DoInitViews again
  15. From   James Plamondon
  16. To Kemink, Joost
  17. CC  MacApp.Tech$
  18.  
  19. Reply to:  DoInitViews again
  20. Dear Mr. Kemink,
  21.  
  22. I read your link this morning, on DoInitViews(), with both pleasure and dread.
  23.  Pleasure, because it contained lots of good ideas, and dread, because (you're
  24. right!) it made DoInitViews() look a lot tougher to write than I had hoped.
  25.  
  26. I had indeed intended to use IRes() to do most of the work for me, and now I
  27. see that I can't. People do mix up their object creation with their object
  28. initialization; MacApp does not recognize a distinction between these two.
  29. IClassName() and IRes(), in which the "I" stands for "initialize," perform
  30. both object creation and initialization.  That is, if I hav a class TFoo that
  31. has contains an object (fBar) of class TBar, then both IFoo() and TFoo.IRes()
  32. create fBar and then initialize it.  Therein lies the fatal flaw.
  33.  
  34. To add view re-initialization to MacApp, I would have to add a basic new
  35. method to TView:  the method TView.ReInitRes().  This method would assume that
  36. whatever allocations  TView.IRes() performs have been done, and would
  37. re-initialize the view to match its resource.  This method could be called by
  38. IRes(), after IRes() had done its allocating.  It would certainly be called by
  39. the proposed routines DoInitViews() and InitAView().  Adding this method to
  40. all of the various view classes in MacApp (31 by my count in 2.0B9) would not
  41. be a trivial task.  However, one of the standard rules-of-thumb in OOP is to
  42. break up class functionality into separate methods wherever it is both
  43. possible and meaningful, so that one can override the fewest possible methods
  44. to change a class' behaviour.  I think that this distinction, between creation
  45. and initialization (which allows re-initialization) is both meaningfull and
  46. possible.
  47.  
  48. What do you think?  Seem like more trouble that it's worth?
  49.  
  50. Looking forward to your response (and to that of any other interested party —
  51. like maybe the MacApp Programming Team), I remain
  52.  
  53. Yours,
  54.  
  55. James Plamondon
  56. Software Engineer
  57. PowerUp! Software
  58. 2929 Campus Drive, Suite 300
  59. San Mateo, CA  94403
  60. (415) 345-5900 x351
  61. AppleLink: PowerUp.Eng
  62.  
  63.